package com.example.demo07cache.controller;

import com.example.demo07cache.entity.Employee;
import com.example.demo07cache.service.JetCacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangxun
 */
@RestController
@RequestMapping("/jetCache")
public class JetCacheController {

    @Autowired
    private JetCacheService jetCacheService;

    @GetMapping("/getEmployeeById/{id}")
    public Employee getEmployeeById(@PathVariable Integer id) {
        return jetCacheService.getEmployeeById(id);
    }
}
